﻿<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" exclude-result-prefixes="xsl msxsl ddwrt" xmlns:ddwrt="http://schemas.microsoft.com/WebParts/v2/DataView/runtime" xmlns:asp="http://schemas.microsoft.com/ASPNET/20" xmlns:__designer="http://schemas.microsoft.com/WebParts/v2/DataView/designer" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:SharePoint="Microsoft.SharePoint.WebControls" xmlns:ddwrt2="urn:frontpage:internal">
  <xsl:output method="html" indent="no" />
  <xsl:decimal-format NaN="" />
  <xsl:param name="dvt_apos">'</xsl:param>
  <xsl:param name="ManualRefresh"></xsl:param>
  <xsl:param name="dvt_firstrow">1</xsl:param>
  <xsl:param name="FileName" />
  <xsl:param name="dvt_nextpagedata" />
  <xsl:variable name="dvt_1_automode">0</xsl:variable>
  <xsl:template match="/" xmlns:asp="http://schemas.microsoft.com/ASPNET/20" xmlns:__designer="http://schemas.microsoft.com/WebParts/v2/DataView/designer" xmlns:SharePoint="Microsoft.SharePoint.WebControls">
    <xsl:choose>
      <xsl:when test="($ManualRefresh = 'True')">
        <table width="100%" border="0" cellpadding="0" cellspacing="0">
          <tr>
            <td valign="top">
              <xsl:call-template name="dvt_1" />
            </td>
            <td width="1%" class="ms-vb" valign="top">
              <img src="/_layouts/images/staticrefresh.gif" id="ManualRefresh" border="0" onclick="javascript: {ddwrt:GenFireServerEvent('__cancel')}" alt="Click here to refresh the dataview." />
            </td>
          </tr>
        </table>
      </xsl:when>
      <xsl:otherwise>
        <xsl:call-template name="dvt_1" />
      </xsl:otherwise>
    </xsl:choose>
  </xsl:template>
  <xsl:template name="dvt_1">
    <xsl:variable name="dvt_StyleName">Table</xsl:variable>
    <xsl:variable name="Rows" select="/All_Results/Result" />
    <xsl:variable name="dvt_RowCount" select="count($Rows)" />
    <xsl:variable name="RowLimit" select="10" />
    <xsl:variable name="FirstRow" select="$dvt_firstrow" />
    <xsl:variable name="LastRow">
      <xsl:choose>
        <xsl:when test="($FirstRow + $RowLimit - 1) &gt; $dvt_RowCount">
          <xsl:value-of select="$dvt_RowCount" />
        </xsl:when>
        <xsl:otherwise>
          <xsl:value-of select="$FirstRow + $RowLimit - 1" />
        </xsl:otherwise>
      </xsl:choose>
    </xsl:variable>
    <xsl:variable name="IsEmpty" select="$dvt_RowCount = 0" />
    <xsl:variable name="dvt_IsEmpty" select="$dvt_RowCount = 0" />
    <xsl:choose>
      <xsl:when test="$dvt_IsEmpty">
        <xsl:call-template name="dvt_1.empty" />
      </xsl:when>
      <xsl:otherwise>
        <table border="0" width="100%" cellpadding="2" cellspacing="0">
          <tr valign="top">
            <xsl:if test="$dvt_1_automode = '1'" ddwrt:cf_ignore="1">
              <th class="ms-vh" width="1%" nowrap="nowrap"></th>
            </xsl:if>
            <th class="ms-vh" nowrap="nowrap">Type</th>
            <th class="ms-vh" nowrap="nowrap">PDM
						<xsl:text xmlns:ddwrt="http://schemas.microsoft.com/WebParts/v2/DataView/runtime" ddwrt:nbsp-preserve="yes" disable-output-escaping="yes">&amp;nbsp;</xsl:text></th>
            <th class="ms-vh" nowrap="nowrap">Item Number</th>
            <th class="ms-vh" nowrap="nowrap">Rev.</th>
            <th class="ms-vh" nowrap="nowrap">Title</th>
            <th class="ms-vh" nowrap="nowrap">State</th>
            <th class="ms-vh" nowrap="nowrap">Owner</th>
            <th class="ms-vh" nowrap="nowrap">Modified</th>
            <th class="ms-vh" nowrap="nowrap">3d</th>
            <th class="ms-vh" nowrap="nowrap">Thumbnail</th>
          </tr>
          <xsl:call-template name="dvt_1.body">
            <xsl:with-param name="Rows" select="$Rows[position() &gt;= $FirstRow and position() &lt;= $LastRow]" />
            <xsl:with-param name="FirstRow" select="1" />
            <xsl:with-param name="LastRow" select="$dvt_RowCount" />
          </xsl:call-template>
        </table>
      </xsl:otherwise>
    </xsl:choose>
    <xsl:call-template name="dvt_1.commandfooter">
      <xsl:with-param name="FirstRow" select="$FirstRow" />
      <xsl:with-param name="LastRow" select="$LastRow" />
      <xsl:with-param name="RowLimit" select="$RowLimit" />
      <xsl:with-param name="dvt_RowCount" select="$dvt_RowCount" />
      <xsl:with-param name="RealLastRow" select="number(ddwrt:NameChanged('',-100))" />
    </xsl:call-template>
  </xsl:template>
  <xsl:template name="dvt_1.body">
    <xsl:param name="Rows" />
    <xsl:param name="FirstRow" />
    <xsl:param name="LastRow" />
    <xsl:for-each select="$Rows">
      <xsl:variable name="dvt_KeepItemsTogether" select="false()" />
      <xsl:variable name="dvt_HideGroupDetail" select="false()" />
      <xsl:if test="(position() &gt;= $FirstRow and position() &lt;= $LastRow) or $dvt_KeepItemsTogether">
        <xsl:if test="not($dvt_HideGroupDetail)" ddwrt:cf_ignore="1">
          <xsl:call-template name="dvt_1.rowview" />
        </xsl:if>
      </xsl:if>
    </xsl:for-each>
  </xsl:template>
  <xsl:template name="dvt_1.rowview">
    <tr>
      <xsl:if test="position() mod 2 = 1">
        <xsl:attribute name="class">ms-alternating</xsl:attribute>
      </xsl:if>
      <xsl:if test="$dvt_1_automode = '1'" ddwrt:cf_ignore="1">
        <td class="ms-vb" width="1%" nowrap="nowrap">
          <span ddwrt:amkeyfield="" ddwrt:amkeyvalue="string($XPath)" ddwrt:ammode="view"></span>
        </td>
      </xsl:if>
      <td class="ms-vb">
        <xsl:if test="normalize-space(innoitemnumber) = ''">
          <img border="0" src="{imageurl/text()}" />
        </xsl:if>
        <xsl:if test="normalize-space(innoitemnumber) != ''">
          <img border="0" src="/_layouts/images/vendetta/16x16_part_family.gif" />
        </xsl:if>
      </td>
      <td class="ms-vb">
        <xsl:if test="normalize-space(innoitemnumber) != ''">
          <a href=" /SitePages/Structure%20Browser.aspx?ID={innoid}&amp;itemType={innotype}">
            <img border="0" src="/_layouts/images/vendetta/16x16_part.gif" width="16" height="16" />
          </a>
        </xsl:if>
      </td>
      <td class="ms-vb">
        <a href=" /SitePages/Structure%20Browser.aspx?ID={innoid}&amp;itemType={innotype}">
          <xsl:value-of select="innoitemnumber" />
        </a>
        <xsl:if test="normalize-space(isdocument) = 'True' and normalize-space(fileextension) != 'ASPX'">
          <span>
            <a href="{url}">
              <xsl:value-of select="filename" />
            </a>
          </span>
        </xsl:if>
      </td>
      <td class="ms-vb">
        <xsl:value-of select="innorevision" />
      </td>
      <td class="ms-vb">
        <xsl:value-of select="innoname" />
        <xsl:if test="normalize-space(innoitemnumber) = ''">
          <span>
            <a href="{url}">
              <xsl:value-of select="title" />
            </a>
          </span>
        </xsl:if>
      </td>
      <td class="ms-vb">
        <xsl:value-of select="innostate" />
        <xsl:if test="normalize-space(innoitemnumber) = ''">
          <span>
            <xsl:value-of select="status" />
          </span>
        </xsl:if>
      </td>
      <td class="ms-vb">
        <xsl:value-of select="innoownedby" />
      </td>
      <td class="ms-vb">
        <xsl:value-of select="innomodifiedby" />
        <xsl:if test="normalize-space(innoitemnumber) = ''">
          <span>
            <xsl:value-of select="modifiedby" />
          </span>
        </xsl:if>
      </td>
      <td class="ms-vb">
        <xsl:if test="normalize-space(innourl3d) != ''">
          <a href=" /SitePages/Structure%20Browser.aspx?ID={innoid}&amp;itemType={innotype}">
            <img border="0" src="/_layouts/images/vendetta/16x16_part.gif" width="16" height="16" />
          </a>
        </xsl:if>
      </td>
      <td class="ms-vb">
        <xsl:if test="normalize-space(innourlthumbnail) != ''">
          <a href="/{innourlthumbnail}">
            <img border="0" src="/{innourlthumbnail}" />
          </a>
        </xsl:if>
      </td>
    </tr>
  </xsl:template>
  <xsl:template name="dvt_1.empty">
    <xsl:variable name="dvt_ViewEmptyText">There are no items to show in this view.</xsl:variable>
    <table border="0" width="100%">
      <tr>
        <td class="ms-vb">
          <xsl:value-of select="$dvt_ViewEmptyText" />
        </td>
      </tr>
    </table>
  </xsl:template>
  <xsl:template name="dvt_1.commandfooter">
    <xsl:param name="FirstRow" />
    <xsl:param name="LastRow" />
    <xsl:param name="RowLimit" />
    <xsl:param name="dvt_RowCount" />
    <xsl:param name="RealLastRow" />
    <table cellspacing="0" cellpadding="4" border="0" width="100%">
      <tr>
        <xsl:if test="$FirstRow &gt; 1 or $LastRow &lt; $dvt_RowCount">
          <xsl:call-template name="dvt_1.navigation">
            <xsl:with-param name="FirstRow" select="$FirstRow" />
            <xsl:with-param name="LastRow" select="$LastRow" />
            <xsl:with-param name="RowLimit" select="$RowLimit" />
            <xsl:with-param name="dvt_RowCount" select="$dvt_RowCount" />
            <xsl:with-param name="RealLastRow" select="$RealLastRow" />
          </xsl:call-template>
        </xsl:if>
      </tr>
    </table>
  </xsl:template>
  <xsl:template name="dvt_1.navigation">
    <xsl:param name="FirstRow" />
    <xsl:param name="LastRow" />
    <xsl:param name="RowLimit" />
    <xsl:param name="dvt_RowCount" />
    <xsl:param name="RealLastRow" />
    <xsl:variable name="PrevRow">
      <xsl:choose>
        <xsl:when test="$FirstRow - $RowLimit &lt; 1">1</xsl:when>
        <xsl:otherwise>
          <xsl:value-of select="$FirstRow - $RowLimit" />
        </xsl:otherwise>
      </xsl:choose>
    </xsl:variable>
    <xsl:variable name="LastRowValue">
      <xsl:choose>
        <xsl:when test="$LastRow &gt; $RealLastRow">
          <xsl:value-of select="$LastRow"></xsl:value-of>
        </xsl:when>
        <xsl:otherwise>
          <xsl:value-of select="$RealLastRow"></xsl:value-of>
        </xsl:otherwise>
      </xsl:choose>
    </xsl:variable>
    <xsl:variable name="NextRow">
      <xsl:value-of select="$LastRowValue + 1"></xsl:value-of>
    </xsl:variable>
    <td nowrap="nowrap" class="ms-paging" align="right">
      <xsl:if test="$dvt_firstrow &gt; 1" ddwrt:cf_ignore="1">
        <a>
          <xsl:attribute name="href">javascript: <xsl:value-of select="ddwrt:GenFireServerEvent('dvt_firstrow={1}')" />;</xsl:attribute>
				Start</a>
        <xsl:text disable-output-escaping="yes" ddwrt:nbsp-preserve="yes">&amp;nbsp;</xsl:text>
        <a>
          <xsl:attribute name="href">javascript: <xsl:value-of select="ddwrt:GenFireServerEvent(concat('dvt_firstrow={',$PrevRow,'}'))" />;</xsl:attribute>
          <img src="/_layouts/images/prev.gif" border="0" alt="Previous" />
        </a>
        <xsl:text disable-output-escaping="yes" ddwrt:nbsp-preserve="yes">&amp;nbsp;</xsl:text>
      </xsl:if>
      <xsl:value-of select="$FirstRow" />
			 - <xsl:value-of select="$LastRowValue" /><xsl:text disable-output-escaping="yes" ddwrt:nbsp-preserve="yes">&amp;nbsp;</xsl:text><xsl:if test="$LastRowValue &lt; $dvt_RowCount or string-length($dvt_nextpagedata)!=0" ddwrt:cf_ignore="1"><a><xsl:attribute name="href">javascript: <xsl:value-of select="ddwrt:GenFireServerEvent(concat('dvt_firstrow={',$NextRow,'}'))" />;</xsl:attribute><img src="/_layouts/images/next.gif" border="0" alt="Next" /></a></xsl:if></td>
  </xsl:template>
</xsl:stylesheet>